import mongoose, { Schema } from 'mongoose';

const schema = new Schema(
  {
    message: { type: Schema.Types.ObjectId, ref: 'Message' },
    toUser: { type: Schema.Types.ObjectId, ref: 'User' },
    noticed: { type: Boolean, default: false },
    createdAt: { type: Date, default: Date.now },
    noticedAt: Date,
  },
  {
    collection: 'mentions',
  },
);

export default mongoose.model('Mention', schema);
